// pages/food/food.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    swiperList: ["http://img.mmifx.com/miniapp/20210701212343.jpg"],
    tagList: [{
        name: "优惠套餐",
        check: true
      },
      {
        name: "美食林榜单",
        check: false
      },
      {
        name: "全部餐厅",
        check: false
      },
      {
        name: "美食攻略",
        check: false
      }
    ],
    selectList: [{
        name: "位置",
        check: false
      },
      {
        name: "菜系",
        check: false
      },
      {
        name: "智能排序",
        check: false
      },
      {
        name: "更多筛选",
        check: false
      }
    ],
    shopList: [{
        name: "花儿胡同音乐酒馆",
        pf: "4.5",
        img: "http://img.mmifx.com/miniapp/20210619161254.png",
        type: "川菜",
        detail: {
          info: "99元酒水套餐",
          tags: ["随时退", "过期退", "免预约"]
        },
        price: {
          less: "已减245元|2.9折",
          price: "99",
          number: "344"
        }
      },
      {
        name: "福朋喜来登酒店",
        pf: "5.0",
        img: "http://img.mmifx.com/miniapp/20210619171534.png",
        type: "粤菜",
        detail: {
          info: "港式点心任君食",
          tags: ["随时退", "过期退"]
        },
        price: {
          less: "已减38元",
          price: "120",
          number: "158"
        }
      },
      {
        name: "滨湖城碧桂园凤凰酒店",
        pf: "5.0",
        img: "http://img.mmifx.com/miniapp/20210619171832.png",
        type: "徽菜",
        detail: {
          info: "6-8人餐",
          tags: ["随时退", "过期退", "免预约"]
        },
        price: {
          less: "已减608元",
          price: "588",
          number: "1196"
        }
      },
      {
        name: "乐富强铂悦酒店悦",
        pf: "4.8",
        img: "http://img.mmifx.com/miniapp/20210619171948.png",
        type: "自助餐",
        detail: {
          info: "亲子家庭自助晚餐",
          tags: ["随时退", "过期退"]
        },
        price: {
          less: "已减347元",
          price: "398",
          number: "745"
        }
      },
    ]
  },
  Back(e) {
    wx.switchTab({
      url: "../index/index"
    })
  },
  tagTap(e) {
    let that = this;
    const tid = e.currentTarget.dataset.tid;
    let tagList = that.data.tagList
    tagList.forEach(element => {
      element.check = false
    });
    tagList[tid].check = true
    that.setData({
      tagList: tagList
    })
  },
  ToHotel() {
    wx.redirectTo({
      url: "../hotels/hotels"
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})